const express = require('express');
const router = express.Router();
const data = [];
for(let i = 1; i < 51; i++)
    data.push({
        id: `${i}`,
        code: `ZR2019082700-${i}`,
        brandCode: 'QR',
        name: `责任单位-${i}`,
        status: 1,
        isSecondClaim: true,
        isInsideShare: false,
        remark: 'string',
        rowVersion: 'string',
        options: ['update', 'start', 'stop']
    });
router.get('/', (req, res) => {
    const {pageIndex, pageSize} = req.query;
    res.json({
        message: 'ok',
        payload: {
            content: data,
            pageIndex: parseInt(pageIndex, 10),
            pageSize: parseInt(pageSize, 10),
            totalElements: 50
        }
    });
});
router.post('/', (req, res) => {
    res.json({
        message: '新增'
    });
});
router.put('/:id', (req, res) => {
    res.json({
        message: '编辑'
    });
});
router.put('/:id/start', (req, res) => {
    res.json({
        message: '启用'
    });
});
router.put('/:id/stop', (req, res) => {
    res.json({
        message: '停用'
    });
});
router.get('/:id', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            id: '1',
            code: 'ZR2019082700-1',
            name: '责任单位001',
            brandId: '1',
            brandCode: 'QR',
            status: 1,
            isSecondClaim: true,
            isInsideShare: false,
            rowVersion: 'string',
            remark: 'string',
            options: ['update', 'start', 'stop'],
            details: [
                {
                    personnelId: '1',
                    personnelName: '小王'
                },
                {
                    personnelId: '2',
                    personnelName: '小李'
                },
                {
                    personnelId: '3',
                    personnelName: '小张'
                }
            ]
        }
    });
});
module.exports = router;
